{extend name="base/common"}

{block name="style"}
<style>
    .shadow{width: 100%;height: 100%;position: absolute;left: 0;top: 0;background: rgba(0,0,0,0.4);z-index: 88;}
</style>
{/block}

{block name="page-header"}
<div class="row wrapper border-bottom white-bg page-heading">
    <div class="col-lg-10">
        <h2>认证管理</h2>
        <ol class="breadcrumb">
            <li>
                <a href="{:Url('Approve/index')}">学员信息</a>
            </li>
            <li class="active">
                <strong>列表</strong>
            </li>
        </ol>
    </div>
    <div class="col-lg-2">
    </div>
</div>
{/block}

{block name="main"}
<div class="wrapper wrapper-content animated fadeInRight">
    <div class="row">
        <div class="col-lg-12">
            <div class="ibox float-e-margins">
                <div class="ibox-title">
                    <form method="get" action="">
                        <div class="col-sm-3" style="width: 40%">
                            <div class="input-group" style="float: left;margin-right: 10px">
                                <input type="text" placeholder="输入VIP" class="input-sm form-control" name="vip" value="{notempty name='Think.get.vip'}{$Think.get.vip}{/notempty}">
                            </div>
                            <div class="input-group">
                                <input type="text" placeholder="输入姓名" class="input-sm form-control" name="name" value="{notempty name='Think.get.name'}{$Think.get.name}{/notempty}">
                                <input type="hidden"  name="type" id="type" value="">
                            <span class="input-group-btn">
                                <button type="submit" class="btn btn-sm btn-primary">查询</button>
                            </span>
                            </div>
                        </div></form>
                    <div class="ibox-tools">
                        <select name="type" style="width: 20%;height: 35px" onchange="changeType()">
                            {empty name="type"}
                            <option value="1" selected >考研学员</option>
                            <option value="2" >专升本学员</option>
                            {else/}
                            <option value="1" {eq name="$type" value="1"}selected {/eq} >考研学员</option>
                            <option value="2" {eq name="$type" value="2"}selected {/eq}>专升本学员</option>
                            {/empty}
                        </select>
                    </div>
                </div>
                <div class="ibox-content">
                    <div class="table-responsive">
                        <table class="table table-striped">
                            <thead>
                            <tr>
                                <th><input class="i-checks check-all" type="checkbox"></th>
                                <th>产品类型</th>
                                <th>姓名</th>
                                <th>VIP账号</th>
                                <th>所属学校</th>
                                <th>手机号</th>
                                <th>操作</th>
                            </tr>
                            </thead>
                            <tbody>
                            {volist name="list" id="vo"}
                            <tr >
                                <td style="vertical-align: middle"><input type="checkbox" class="i-checks" name="input[]"></td>
                                <td width="15%" style="vertical-align: middle">{$vo.product|iconv='gbk','utf-8//ignore',### || default='暂无'}</td>
                                <td width="10%" style="vertical-align: middle">{$vo.st_name|iconv='gbk','utf-8//ignore',### || default='暂无'}</td>
                                <td width="20%" style="vertical-align: middle">{$vo.order_id|get_order=###,$vo.type || default='暂无'}</td>
                                <td class="name" width="25%" style="vertical-align: middle">{$vo.s_id|get_Info=###,false,$vo.type}</td>
                                <td width="20%" style="vertical-align: middle"><input type="text" style="width: 260px" name="tel" value="{$vo.s_id|get_Info=###,true,$vo.type}"/></td>
                                <td width="10%" style="vertical-align: middle">
                                    <a data-toggle="modal" data-id="{$vo.s_id}" class="btn btn-sm btn-primary check">确认</a>
                                </td>
                            </tr>
                            {/volist}
                            </tbody>
                            <tfoot>
                            <tr>
                                <td colspan="10">
                                    <div class="page">{$list->render()}</div>
                                </td>
                            </tr>
                            </tfoot>
                        </table>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
<iframe id="iframe" src="" style="height: 80%;width: 1000px;z-index: 99;position: absolute;top: 10%;border: 0;left: 10%;background: #fff;display: none;" scrolling="auto" seamless></iframe>
<div class="shadow" style="display: none"></div>
{/block}

{block name="script"}
<script src="__ADMIN__/js/plugins/iCheck/icheck.min.js"></script>
<script>
    highlight_subnav("{:Url('Approve/index')}");
    $(document).ready(function(){
        $('.i-checks').iCheck({
            checkboxClass: 'icheckbox_square-green',
            radioClass: 'iradio_square-green',
        });
        $('.check-all').on('ifChecked', function(event){
            $('input').iCheck('check');
        });

        $('.check-all').on('ifUnchecked', function(event){
            $('input').iCheck('uncheck');
        });
    });
    $(".check").on("click",function(){
        var id = $(this).attr('data-id');
        var tel = $("input[name='tel']").val();
        var type = $("select[name='type']").val();
        $.ajax({
            type:"post",
            url:"{:Url('Approve/Play')}",
            data:{
                id:id,
                tel:tel,
                type:type
            },
            success:function(data){
                if(data.code == 1){
                    $("#myModal").modal('hide');
                    updateAlert("操作成功",'success');
                    setTimeout(function(){
                        window.location.reload();
                    },2000)
                }else{
                    updateAlert("操作失败",'error');
                }
            }
        });
    });
    function changeType(){
        var types = $("select[name='type']").val();
        location.href = "{:Url('Approve/index')}?type="+types;
    }
    var typess = $("select[name='type']").val();
    document.getElementById('type').value = typess;
</script>
{/block}